package com.molichuxing.services.infrastructure.dao;

import com.molichuxing.framework.dao.RootMapper;
import com.molichuxing.services.infrastructure.bean.VersionMobileBean;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

public interface VersionMobileMapper extends RootMapper<VersionMobileBean> {

    /**
     * 根据渠道查询app版本
     * @param channel
     * @return
     */
    List<VersionMobileBean> findNewestByChannel(@Param("channel") String channel);

    /**
     * 根据设备和设备版本号查询数据
     * @param appVersion
     * @param channel
     * @return
     */
    List<VersionMobileBean> findByVersionAndChannel(@Param("appVersion") String appVersion, @Param("channel") String channel);

    /**
     * 判断两个时间段中是否有强制更新
     * @param channel
     * @param startDate
     * @param endDate
     * @return
     */
    List<VersionMobileBean> findIsUpgradeBetweenDate(@Param("channel") String channel, @Param("startDate") LocalDateTime startDate, @Param("endDate") LocalDateTime endDate);
}